package com.xm.xmapp.request.bean;

import com.xm.xmapp.app.Constants;
import com.xm.xmapp.app.MyAppcation;
import com.xm.xmapp.tools.Des4;
import com.xm.xmapp.tools.Tools;

public abstract class BaseBeanRequest {
	public abstract String getUrl();

	/**
	 * 设置当前接口是否需要登陆才能访问的接口
	 * 
	 * @return
	 */
	public boolean isLogin() {

		return false;
	}

	/**
	 * 设置是否需要缓存，默认不需要
	 * 
	 * @return
	 */
	public boolean isCache() {

		return false;
	}

	/**
	 * 是否返回原始数据自行处理,默认不返回
	 */

	public boolean isData() {
		return false;
	}

	public String getCacheString() {
		return getUrl().replaceAll(Constants.baseUrl, Constants.v);
	}

	public Object rnd = Des4.encode(System.currentTimeMillis() / 1000 + ""),
			client = 2,
			uid = MyAppcation.getMyAppcation().getUserBean() == null ? ""
					: MyAppcation.getMyAppcation().getUserBean().user_id,
			token = "", sign = "1", version = Tools.getVersionCode();

}
